package com.skywolf.chem.match.common.enums;

/**
 * @Author sj
 * Date on 2021/10/9  10:41
 * @Version 1.0
 */
public enum RefundStatusEnum {

    //成功
    SUCCESS(1, "SUCCESS"),
    //失败
    REFUNDCLOSE(0, "REFUNDCLOSE"),
    //退款异常 退款到银行发现用户的卡作废或者冻结了，导致原路退款银行卡失败，可前往商户平台（pay.weixin.qq.com）-交易中心，手动处理此笔退款。
    CHANGE(2, "CHANGE"),
    //退款中
    PROCESSING(3, "PROCESSING");

    private Integer status;
    private String name;

    RefundStatusEnum(final Integer status, final String name) {
        this.status = status;
        this.name = name;
    }

    public Integer getStatus() {
        return this.status;
    }

    public String getName() {
        return name;
    }

    public static RefundStatusEnum getByName(String name) {
        RefundStatusEnum refundStatusEnum = null;

        for (RefundStatusEnum value : values()) {
            if (value.getName().equals(name)) {
                refundStatusEnum = value;
            }
        }
        return refundStatusEnum;
    }
}
